//
//  NSBundle+MoreLanguageString.m
//  SMealUserSide
//
//  Created by apple on 2018/2/10.
//  Copyright © 2018年 yaozhengzheng. All rights reserved.
//

#import "NSBundle+MoreLanguageString.h"

@implementation NSBundle (MoreLanguageString)
+ (instancetype)ml_localBundle
{
    NSString *languageType = [[NSUserDefaults standardUserDefaults] objectForKey:ML_AppLanguageKey];
    NSBundle *localBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",languageType] ofType:@"lproj"]];
    return localBundle;
}
+ (NSString *)ml_localizedStringForKey:(NSString *)key
{
    return [self ml_localizedStringForKey:key value:nil];
}

+ (NSString *)ml_localizedStringForKey:(NSString *)key value:(NSString *)value
{
    NSString *string = [NSString stringWithFormat:@"%@", [[self ml_localBundle] localizedStringForKey:(key) value:nil table:@"NSCustomLanguage"]];
    return string;
}
@end
